
import React, { Component } from 'react'

import { Route, Link } from 'react-router-dom'

import Child1 from './views/Child1'
import Child2 from './views/Child2'

class App2 extends Component {
  render() {
    return (
      <div>
        <li><Link to="/child1">组件1</Link></li>
        <li><Link to="/child2/200?name=张三">组件2</Link></li>

        <Route path="/child1?id=1" component={Child1} />
        {/* 必填路由参数 */}
        {/* <Route path="/child2/:id" component={Child2} /> */}
        <Route path="/child2/:id?" component={Child2} />
      </div>
    );
  }
}

export default App2;
